//
//  UILabelExt.swift
//  test-ios
//
//  Created by wyz5204 on 2023/6/6.
//

import Foundation
import UIKit

//MARK: UILabel
extension UILabel {
    /// - Description 统一设置label属性
    /// - Parameters:
    ///   - size: 字体大小
    ///   - textColor: 文字颜色
    ///   - weight: 字重
    /// - Returns: UILabel实例化对象
    
    class func glLabel(title: String? = nil, size: CGFloat, textColor: UIColor, weight: UIFont.Weight) -> UILabel {
        let label = UILabel.init()
        label.text = title
        label.textColor = textColor
        label.font = UIFont.systemFont(ofSize: size, weight: weight)
        return label
        
    }
    
    func setTitleAndColor(_ text : String , color: UIColor = .black){
        self.text = text
        self.textColor = color
    }
}
